﻿<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio Developer Edition 9.0.11.3078 (http://www.liquid-technologies.com)-->
<xs:schema finalDefault="" elementFormDefault="qualified" version="v7.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="rewriter">
        <xs:complexType>
            <xs:choice maxOccurs="unbounded">
                <xs:group ref="SimpleActions" />
                <xs:group ref="ComplexActions" />
                <xs:group ref="Commands" />
            </xs:choice>
            <xs:attribute name="file" type="xs:string" />
        </xs:complexType>
    </xs:element>
    <xs:group name="SimpleActions">
        <xs:choice>
            <xs:element name="rewrite">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:normalizedString">
                            <xs:attributeGroup ref="RewriteActions" />
                            <xs:attributeGroup ref="ConditionAttributes" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="norewrite">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:normalizedString">
                            <xs:attributeGroup ref="ConditionAttributes" />
                            <xs:attribute ref="url" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="redirect">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:normalizedString">
                            <xs:attributeGroup ref="RewriteActions" />
                            <xs:attribute name="permanent" type="xs:boolean" default="true" use="optional" />
                            <xs:attributeGroup ref="ConditionAttributes" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="forbidden" type="xs:normalizedString" />
            <xs:element name="gone" type="xs:normalizedString" />
            <xs:element name="not-allowed" type="xs:normalizedString" />
            <xs:element name="not-found" type="xs:normalizedString" />
            <xs:element name="not-implemented" type="xs:normalizedString" />
            <xs:element name="add">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:normalizedString">
                            <xs:attribute ref="header" />
                            <xs:attribute name="value" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="set">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:normalizedString">
                            <xs:attribute ref="cookie" />
                            <xs:attribute ref="property" />
                            <xs:attribute name="value" />
                            <xs:attribute ref="status" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="error-handler">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:normalizedString">
                            <xs:attribute ref="status" use="required" />
                            <xs:attribute ref="url" />
                            <xs:attribute name="type" type="xs:string" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
        </xs:choice>
    </xs:group>
    <xs:group name="ComplexActions">
        <xs:choice>
            <xs:element name="if">
                <xs:complexType>
                    <xs:choice maxOccurs="unbounded">
                        <xs:group ref="ComplexActions" />
                        <xs:group ref="SimpleActions" />
                    </xs:choice>
                    <xs:attributeGroup ref="ConditionAttributes" />
                    <xs:attribute ref="url" />
                </xs:complexType>
            </xs:element>
            <xs:element name="unless">
                <xs:complexType>
                    <xs:choice maxOccurs="unbounded">
                        <xs:group ref="ComplexActions" />
                        <xs:group ref="SimpleActions" />
                    </xs:choice>
                    <xs:attributeGroup ref="ConditionAttributes" />
                    <xs:attribute ref="url" />
                </xs:complexType>
            </xs:element>
        </xs:choice>
    </xs:group>
    <xs:group name="Commands">
        <xs:choice>
            <xs:element name="mapping">
                <xs:complexType>
                    <xs:sequence maxOccurs="unbounded">
                        <xs:element name="map">
                            <xs:complexType>
                                <xs:simpleContent>
                                    <xs:extension base="xs:normalizedString">
                                        <xs:attribute name="from" use="required" />
                                        <xs:attribute name="to" use="required" />
                                    </xs:extension>
                                </xs:simpleContent>
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                    <xs:attribute name="name" use="required">
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:whiteSpace value="collapse" />
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:attribute>
                </xs:complexType>
            </xs:element>
            <xs:element name="register">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:normalizedString">
                            <xs:attribute name="parser" type="xs:string" />
                            <xs:attribute name="transform" type="xs:string" />
                            <xs:attribute name="logger" type="xs:string" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="default-documents">
                <xs:complexType>
                    <xs:sequence maxOccurs="unbounded">
                        <xs:element name="document" type="xs:normalizedString" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:choice>
    </xs:group>
    <xs:attributeGroup name="ConditionAttributes">
        <xs:attribute name="address" type="xs:string" />
        <xs:attribute name="match" type="xs:string" />
        <xs:attribute name="method">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:whiteSpace value="collapse" />
                    <xs:enumeration value="GET" />
                    <xs:enumeration value="POST" />
                    <xs:enumeration value="PUT" />
                    <xs:enumeration value="DELETE" />
                    <xs:enumeration value="OPTIONS" />
                    <xs:enumeration value="HEAD" />
                    <xs:enumeration value="TRACE" />
                    <xs:enumeration value="CONNECT" />
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="exists" type="xs:string" />
        <xs:attribute ref="header" />
        <xs:attribute ref="cookie" />
        <xs:attribute ref="property" />
        <xs:attribute ref="status" />
    </xs:attributeGroup>
    <xs:attribute name="header" type="xs:string" />
    <xs:attribute name="cookie" type="xs:string" />
    <xs:attribute name="property" type="xs:string" />
    <xs:attribute name="status">
        <xs:simpleType>
            <xs:restriction base="xs:integer">
                <xs:minInclusive value="200" />
                <xs:maxInclusive value="600" />
            </xs:restriction>
        </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="url" type="xs:string" />
    <xs:attributeGroup name="RewriteActions">
        <xs:attribute name="to" type="xs:string" use="required" />
        <xs:attribute name="processing">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="stop" />
                    <xs:enumeration value="continue" />
                    <xs:enumeration value="restart" />
                    <xs:whiteSpace value="collapse" />
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute ref="url" />
    </xs:attributeGroup>
</xs:schema>
